package com.tengol.leetcode;

import com.tengol.leetcode.entity.TreeNode;

import java.util.Objects;

/**
 * No1028RecoverTreeFromPreOrderTraversal
 *
 * @author dongrui
 * @date 2020/6/18 12:09
 */
public class No1028RecoverTreeFromPreOrderTraversal {
    private int idx = 0;
    public TreeNode recoverFromPreorder(String S) {
        if(Objects.isNull(S) || S.length() == 0){
            return null;
        }
        // 如果只有一个元素
        if(S.length() == 1){
            return new TreeNode(Integer.parseInt(S));
        }
        // 开始遍历
        while(idx < S.length()){

        }

        return null;
    }

    private String getSep(String S){
        StringBuffer sb = new StringBuffer();

        return sb.toString();
    }

    public static void main(String[] args) {
        No1028RecoverTreeFromPreOrderTraversal no1028 = new No1028RecoverTreeFromPreOrderTraversal();
        String case1 = "1-2--3--4-5--6--7";
        TreeNode result1 = no1028.recoverFromPreorder(case1);
        System.out.println(result1);
        String case2 = "1-2--3---4-5--6---7";
        TreeNode result2 = no1028.recoverFromPreorder(case1);
        System.out.println(result2);
        String case3 = "1-401--349---90--88";
        TreeNode result3 = no1028.recoverFromPreorder(case1);
        System.out.println(result3);

    }

}
